/*
 * Licensed to the 南京汇海交通科技有限公司
 *
 * Copyright (c) 2025.
 * All rights reserved.
 *
 * 本软件属南京汇海交通科技有限公司所有，在未获得南京汇海交通科技有限公司正式授权情况下，任何企业和个人，不能获取、阅读、安装、传播本软件涉及的任何受知识产权保护的内容。
 */
package com.cje.basic.openfeign.fallback;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.chframework.boot.core.response.result.ApiResult;
import com.chframework.boot.core.response.status.ApiStatusEnum;
import com.cje.basic.pojo.bo.DictDataBO;
import com.cje.basic.pojo.bo.DictTypeBO;
import com.cje.basic.pojo.dto.DictDataPageDTO;
import com.cje.basic.pojo.dto.DictTypeDTO;
import com.cje.basic.pojo.dto.DictTypePageDTO;
import com.cje.basic.service.DictService;
import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;

@Slf4j
public class DictServiceFallback implements DictService {

    @Override
    public ApiResult<IPage<DictTypeBO>> pageDictType(DictTypePageDTO dictTypePageDTO) {
        log.error("远程服务降级执行。\r\n\r\tat {}", Thread.currentThread().getStackTrace()[1].toString());
        return ApiResult.<IPage<DictTypeBO>>build()
                .setStatus(ApiStatusEnum.ERR_B0220)
                .setResult(null);
    }

    @Override
    public ApiResult<PageInfo<DictDataBO>> pageDictData(DictDataPageDTO dictDataPageDTO) {
        log.error("远程服务降级执行。\r\n\r\tat {}", Thread.currentThread().getStackTrace()[1].toString());
        return ApiResult.<PageInfo<DictDataBO>>build()
                .setStatus(ApiStatusEnum.ERR_B0220)
                .setResult(null);
    }

    @Override
    public ApiResult<DictTypeBO> getDictType(DictTypeBO dictTypeBO) {
        log.error("远程服务降级执行。\r\n\r\tat {}", Thread.currentThread().getStackTrace()[1].toString());
        return ApiResult.<DictTypeBO>build()
                .setStatus(ApiStatusEnum.ERR_B0220)
                .setResult(null);
    }

    @Override
    public ApiResult<Boolean> postDictData(DictTypeDTO dictTypeDTO) {
        log.error("远程服务降级执行。\r\n\r\tat {}", Thread.currentThread().getStackTrace()[1].toString());
        return ApiResult.<Boolean>build()
                .setStatus(ApiStatusEnum.ERR_B0220)
                .setResult(null);
    }

    @Override
    public ApiResult<Boolean> deleteDictType(DictTypeDTO dictTypeDTO) {
        log.error("远程服务降级执行。\r\n\r\tat {}", Thread.currentThread().getStackTrace()[1].toString());
        return ApiResult.<Boolean>build()
                .setStatus(ApiStatusEnum.ERR_B0220)
                .setResult(null);
    }

    @Override
    public ApiResult<Boolean> putDictType(DictTypeBO dictTypeBO) {
        log.error("远程服务降级执行。\r\n\r\tat {}", Thread.currentThread().getStackTrace()[1].toString());
        return ApiResult.<Boolean>build()
                .setStatus(ApiStatusEnum.ERR_B0220)
                .setResult(null);
    }

    @Override
    public ApiResult<Boolean> putDictData(DictDataBO dictDataBO) {
        log.error("远程服务降级执行。\r\n\r\tat {}", Thread.currentThread().getStackTrace()[1].toString());
        return ApiResult.<Boolean>build()
                .setStatus(ApiStatusEnum.ERR_B0220)
                .setResult(null);
    }

}
